
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'image-form',
	'action' => Yii::app()->createUrl('image/update&id='.$model->id),
	'enableAjaxValidation'=>false,
	'htmlOptions' => array('enctype' => 'multipart/form-data'),
)); ?>

	<tr>
		<td colspan="2" align="right"><hr noshade width="100%" color="#CCCCCC" size="1" ></td>
    </tr>
	<tr>
		<td align="center" class="titresIndex" colspan="2">Module Image</td>
	</tr>	    
	<tr>
		<td align="right"><?php echo $form->labelEx($model,'image'); ?></td>	
        <td><?php echo CHtml::activeFileField($model, 'image',array('class'=>'searchAAdvanced')); ?>
   			<?php echo $form->error($model,'image'); ?>
		</td>
	</tr>	
		
	<?php 
	// Affichage des images du lieu

	foreach($model->images as $image)
	{
		$image_path=$image->getImagePath('210x70');	
			
	?>
	<tr>
		<td colspan="2" align="right"><hr noshade width="100%" color="#CCCCCC" size="1" ></td>
	</tr>	
	<tr>
		<td><?php echo Chtml::image($image_path,'');?> <?php echo CHtml::link(Chtml::image(Yii::app()->baseUrl.'/images/icon-poubelle.png',''),Yii::app()->baseUrl.'/backend.php?r=image/delete&id='.$image->id, array('confirm' => 'Are you sure?'));?></td>		    
        <td align="left">
			<table class="texteSimple" width="100%;">  
			<tr>
				<td>				
				<?php echo $form->labelEx($image,'imageDescriptionFr'); ?><br><?php echo Chtml::textField('imageDescriptionFr'.$image->id,$image->getImageDescriptionFr(),array('class'=>'searchAAdvanced','size'=>50,'maxlength'=>250)); ?>
				</td> 
		   		<td rowspan="2" valign="middle">Affichage : <br><?php echo Chtml::checkbox('type'.$image->id,$image->type,array('class'=>'searchAAdvanced')).' Photo de Profil de la Fiche';?></td>   	
			</tr>
			<tr>
				<td align="left">
				<?php echo $form->labelEx($image,'imageDescriptionEn' ); ?><br><?php echo Chtml::textField('imageDescriptionEn'.$image->id,$image->getImageDescriptionEn(),array('class'=>'searchAAdvanced','size'=>50,'maxlength'=>250)); ?>
				</td>
			</tr>
			</table>
		</td>
	</tr>				
	<?php 
	}
	?>			

 	<tr>
		<td>&nbsp;</td>
        <td align="left"><?php echo CHtml::submitButton($model->isNewRecord ? 'Enregistrer' : 'Sauvegarder',array('class'=>'searchAAdvanced',)); ?></td>
    </tr>		
<?php $this->endWidget(); ?>